home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / BARNET / ARMLINUX / ISCAFS / PATCH-0-04 < prev   
Text File  |  1998-04-05  |  6KB  |  158 lines

  1. Okey-dokey, here's the discname reading patch.
  2. You were saving some registers that I simply wasn't using in
  3. Image_IdentifyDisc, so I changed it.
  4. I'm not entirely sure why you decided to go for signed arithmetic rather
  5. than unsigned - surely a length is not a negative quantity?
  6.  
  7. diff -urN Dev.Base.b.Workspace !IscaFS.b.Workspace
  8. --- Dev.Base.b.Workspace    Sat Mar 28 13:24:06 1998
  9. +++ !IscaFS.b.Workspace     Wed Apr 01 19:25:34 1998
  10. @@ -30,7 +30,7 @@
  11.  ENDIF
  12.  
  13.  REM The MAlloc vectors are added after the main workspace is stored, so
  14. -REM lwn_workspace% is NOT the real length which will be allocted to the
  15. +REM len_workspace% is NOT the real length which will be allocated to the
  16.  REM workspace.
  17.  malloc_tabbase%        = len_workspace%
  18.  malloc_claim%        = malloc_tabbase%+0
  19. @@ -81,34 +81,46 @@
  20.  REM superblock structure (inside image descriptor structure)
  21.  superblock%        = 40
  22.  s_inodes_count%        = superblock%
  23. -s_blocks_count%        = superblock%+4
  24. -s_r_blocks_count%    = superblock%+8
  25. -s_free_blocks_count%    = superblock%+12
  26. -s_free_inodes_count%    = superblock%+16
  27. -s_first_data_block%    = superblock%+20
  28. -s_log_block_size%    = superblock%+24
  29. -s_log_frag_size%    = superblock%+28
  30. -s_blocks_per_group%    = superblock%+32
  31. -s_frags_per_group%    = superblock%+36
  32. -s_inodes_per_group%    = superblock%+40
  33. -s_mtime%        = superblock%+44
  34. -s_wtime%        = superblock%+48
  35. -s_mnt_count%        = superblock%+52
  36. -s_max_mnt_count%    = superblock%+54
  37. -s_magic%        = superblock%+56
  38. -s_state%        = superblock%+58
  39. -s_errors%        = superblock%+60
  40. -s_minor_rev_level%    = superblock%+62
  41. -s_lastcheck%        = superblock%+64
  42. -s_checkinterval%    = superblock%+68
  43. -s_creator_os%        = superblock%+72
  44. -s_rev_level%        = superblock%+76
  45. +s_blocks_count%        = s_inodes_count%+4
  46. +s_r_blocks_count%    = s_blocks_count%+4
  47. +s_free_blocks_count%    = s_r_blocks_count%+4
  48. +s_free_inodes_count%    = s_free_blocks_count%+4
  49. +s_first_data_block%    = s_free_inodes_count%+4
  50. +s_log_block_size%    = s_first_data_block%+4
  51. +s_log_frag_size%    = s_log_block_size%+4
  52. +s_blocks_per_group%    = s_log_frag_size%+4
  53. +s_frags_per_group%    = s_blocks_per_group%+4
  54. +s_inodes_per_group%    = s_frags_per_group%+4
  55. +s_mtime%        = s_inodes_per_group%+4
  56. +s_wtime%        = s_mtime%+4
  57. +s_mnt_count%        = s_wtime%+4
  58. +s_max_mnt_count%    = s_mnt_count%+2
  59. +s_magic%        = s_max_mnt_count%+2
  60. +s_state%        = s_magic%+2
  61. +s_errors%        = s_state%+2
  62. +s_minor_rev_level%    = s_errors%+2
  63. +s_lastcheck%        = s_minor_rev_level%+2
  64. +s_checkinterval%    = s_lastcheck%+4
  65. +s_creator_os%        = s_checkinterval%+4
  66. +s_rev_level%        = s_creator_os%+4
  67. +s_def_resuid%        = s_rev_level%+4
  68. +s_def_resgid%        = s_def_resuid%+2
  69. +s_first_ino%        = s_def_resgid%+2
  70. +s_inode_size%        = s_first_ino%+4
  71. +s_block_group_nr%    = s_inode_size%+2
  72. +s_feature_compat%    = s_block_group_nr%+2
  73. +s_feature_incompat%    = s_feature_compat%+4
  74. +s_feature_ro_compat%    = s_feature_incompat%+4
  75. +s_uuid%            = s_feature_ro_compat%+4
  76. +s_volume_name%        = s_uuid%+16
  77. +s_last_mounted%        = s_volume_name%+16
  78. +s_reserved%        = s_last_mounted%+64
  79.  REM end of superblock structure
  80.  REM Note: len_superblock% is not the actual length of a superblock, but the
  81.  REM length of it that should be read into the block.
  82. -len_superblock%        = s_rev_level%+4-superblock%
  83. +len_superblock%        = s_reserved%+4-superblock%
  84.  
  85. -len_mount%        = s_rev_level%+4
  86. +len_mount%        = s_reserved%+4
  87.  
  88.  
  89.  
  90. @@ -139,8 +151,8 @@
  91.  
  92.  
  93.  REM image flags
  94. -mntflag_size2%        = 1        :REM set if blocks are 2k long
  95. -mntflag_size4%        = 1<<1        :REM set if blocks are 4k long
  96. +REM mntflag_size2%        = 1        :REM set if blocks are 2k long
  97. +REM mntflag_size4%        = 1<<1        :REM set if blocks are 4k long
  98.  mntflag_partition%    = 1<<2        :REM set if it's a partition (not an image)
  99.  
  100.  
  101. diff -urN Dev.Base.s.Image !IscaFS.s.Image
  102. --- Dev.Base.s.Image        Sat Mar 28 16:42:22 1998
  103. +++ !IscaFS.s.Image         Wed Apr 01 19:21:16 1998
  104. @@ -213,13 +213,9 @@
  105.  ;    r6  =    new sector cache handle
  106.  ;    AORP
  107.  ;------------------------
  108. -    FNfunction("r0-r5,r7")
  109. -;P This is MW's version of this function (which does things properly)
  110. -;P Errr... well, that's what I thought.  Actually, this was corrupting
  111. -;P registers, and since it's a Service call, not a filesystem entry point,
  112. -;P that's a Bad Thing (TM).
  113. +    FNfunction("r2-r4,r7")
  114.  ;------------------------
  115. -; for now, don't worry about sequence sides, shapes etc
  116. +; an ext2 floppy might have almost any shape.  Let's believe Filecore.
  117.  ;------------------------
  118.  ; try to recognise the disc from the special word in the first super block
  119.      MOV    r1,#9+(1<<6)        ; read sectors via cache, ignore esc
  120. @@ -226,8 +222,8 @@
  121.      ORR    r1,r1,r5,LSL #6
  122.      MOV    r4,#s_magic%+4
  123.      CMP    r3, #5
  124. -    MOVLE    r7, #0
  125. -    MOVGT    r7, r2
  126. +    MOVLO    r7, #0
  127. +    MOVHS    r7, r2
  128.      LDR    r2,[r5,#&c]        ; disc address of root directory
  129.      MOV    r2,r2,LSL #28
  130.      ADD    r2,r2,#1024        ; disc address
  131. @@ -240,6 +236,7 @@
  132.      MOV    r2, r2, LSL #16        ;M
  133.      EOR    r2, r2, #&ef000000
  134.      TEQ    r2, #&00530000
  135. +    MOVNE    r1, #&69
  136.      FNcreturn("NE")
  137.  ;------------------------
  138.  ; it is an ext2 disc - return the right info and update the disc shape
  139. @@ -248,6 +245,18 @@
  140.      ADD    r2, r2, #10        ;M
  141.      MOV    r1, r1, LSL r2
  142.      STR    r1,[r5,#16]        ; disc_size
  143. +    ADD    r4, r4, #s_volume_name%-superblock%
  144. +    LDMIA    r4, {r1-r3}        ; get first 12 bytes of name
  145. +    MOV    r3, r3, LSL #16        ; drop last 2 characters
  146. +    ORR    r3, r3, r2, LSR #16    ; and put the two from r2 in
  147. +    MOV    r2, r2, LSL #16        ; drop last 2 characters
  148. +    ORR    r2, r2, r1, LSR #16    ; and put the two from r2 in
  149. +    MOV    r1, r1, LSL #16        ; put the first two chars at the top
  150. +    LDR    r14, [r4, #s_volume_name%-s_wtime%]
  151. +    MOV    r14, r14, LSL #16    ; put the lsb at the top..
  152. +    ORR    r1, r1, r14, LSR #16    ; and then ORR it into the bottom.
  153. +    ADD    r4, r5, #20
  154. +    STMIA    r4, {r1-r3}        ; set up the name & cycle ID
  155.      TEQ    r7, #0
  156.      BEQ    _no_space_for_formatname
  157.      LDR    r2, _ext2_word
  158.